require 'xm/platform'
timestamp = Time.now.strftime("%Y%m%d%H%M%S")
gc_log = XM::Platform.config.comps["xafsvc"].root.join("containers/jetty/log/gc_#{timestamp}.log")
error_log = XM::Platform.config.comps["xafsvc"].root.join("containers/jetty/log/error_#{timestamp}.log")
group :component do
  java(:xafsvc, "comps/xafsvc/containers/jetty",
       :order => 88,
       :start => {
           :jar => "start.jar",
	   :arguments => "-Dconf=../../conf/global.properties"
       },
       :started => {:heartbeat => "8082", :url => "/moc",:max => 10.minutes},
       :stopped => {:max => 30.seconds},
       :debug =>"2016",
       :java_options => %W{-XX:MaxPermSize=72M -Xms900M -Xmx900M -XX:+ScavengeBeforeFullGC -XX:+UseTLAB -XX:+UseParallelOldGC -XX:ParallelGCThreads=4 -XX:+DisableExplicitGC -XX:+UseGCOverheadLimit -XX:+HeapDumpOnOutOfMemoryError -verbose:gc -Xloggc:#{gc_log} -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:ErrorFile=#{error_log} -DSTOP.PORT=8078 -DSTOP.KEY=secret -DAPI_VISIT_PROTECTION=protection_with_4_12.xml},
       :jmx => "9016",
       :mandatory => true,
       :stop => :kill
  )
end